package com.jiangyg.mall.member.dto;

import com.jiangyg.mall.core.support.validation.constraints.AlphanumericUnderline;
import com.jiangyg.mall.core.support.validation.constraints.Phone;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 类描述：会员收货地址
 *
 * @author jiangyg
 * @email email@jiangyg.com
 * @date 2021-10-30 07:33:08
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode
public class MemberReceiveAddressDTO implements Serializable {

    private static final long serialVersionUID = -15420153934014106L;

    /**
     * id
     */
    private Long id;

    /**
     * 收货人姓名
     */
    @NotNull
    @Length(min = 2, max = 20)
    private String name;

    /**
     * 电话
     */
    @Phone
    @NotNull
    @Length(max = 20)
    private String phone;

    /**
     * 邮政编码
     */
    @NotNull
    @Length(max = 20)
    @AlphanumericUnderline
    private String postcode;

    /**
     * 省份/直辖市
     */
    @NotNull
    @Length(max = 20)
    private String province;

    /**
     * 城市
     */
    @NotNull
    @Length(max = 20)
    private String city;

    /**
     * 区
     */
    @NotNull
    @Length(max = 20)
    private String region;

    /**
     * 详细地址(街道)
     */
    @NotNull
    @Length(max = 100)
    private String detailAddress;

    /**
     * 省市区代码
     */
    private String areacode;

    /**
     * 是否默认
     */
    @NotNull
    private Integer isDefault;

}
